package com.snopy.designPattern.command;

import com.snopy.designPattern.command.inter.Order;

import java.util.ArrayList;
import java.util.List;

/**
 * @author snopy
 * @version 1.0.0
 * @classname Broker
 * @description
 * @email 77912204@qq.com
 * @date 2022/03/04 14:55
 */
public class Broker {
    private List<Order> orderList = new ArrayList<>();

    public void takeOrder(Order order){
        orderList.add(order);
    }
    public void placeOrders(){
        for (Order order:orderList) {
            order.excute();
        }
        orderList.clear();
    }
}
